#====================================================
# Driver for Winbond USB2WLAN b/g WiFi device on Linux 2.6
#
# Compile with "make DEBUG=1" to enable debugging output
#
# Written by Ferenc Csicsova & Karoly Kasza
# Based on RTL8187 driver in kernel.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#====================================================

KERNELDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

wbusb-objs := wbusb_dev.o wbusb_reg.o wbusb_rx.o wbusb_airoha.o
obj-m := wbusb.o

ifdef DEBUG
WBCFLAGS := -DDEBUG1
endif

ifdef DEBUG_REG
WBCFLAGS := $(WBCFLAGS) -DDEBUG2
endif

ifdef DEBUG_VM0
WBCFLAGS := $(WBCFLAGS) -DDEBUG3
endif

ifdef DEBUG_RX
WBCFLAGS := $(WBCFLAGS) -DDEBUG4
endif

ifdef DEBUG_ALL
WBCFLAGS := -DDEBUG1 -DDEBUG2 -DDEBUG3 -DDEBUG4
endif

all:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) EXTRA_CFLAGS+="$(WBCFLAGS)" modules

clean:
	rm -f *.o *~ .*.cmd *.ko *.mod.c .*.o.d
	rm -rf Module*.symvers .tmp_versions modules.order
